function s = getNetParamsSize(network)

[NetFile, WeightsFile] = mycaffe.getNetSetting(network);

%%
mycaffe.reset_all();

if ~mycaffe.useGPU
    warning('Using CPU mode!');
    caffe.set_mode_cpu();
else
    caffe.set_mode_gpu();
    gpu_id = 0; % use the second gpu
    caffe.set_device(gpu_id);
end

net = caffe.Net(NetFile, WeightsFile, 'test');

%%
blob_names = net.blob_names;
s = 0;
for i = 1 : length(blob_names)
    blob = blob_names{i};
    if isbeginwith(blob, 'data') || isbeginwith(blob, 'pool') || isbeginwith(blob, 'prob')
        continue
    end
    filter = net.layers(blob).params(1).get_data();
    s = s + numel(filter);
end

%%
% (4*4*20 + 3*3*20*40 + 3*3*40*60 + 2*2*80 + 160*160 + 360*160)*60
% DeepID = [4*4*1*20, 3*3*20*40, 3*3*40*60, 2*2*60*80*2*1 60*2*3*160 4*2*80*160];
% sparseConvNets = 3*3*(3*64 + 64*64 + 64*96 + 96*96 + 96*192 + 192*192 + 192*256 + 256*256 + 256^2*20 + 256^2*6) + 3*2*256*512;

% VGGface = 3*3*(3*64 + 64^2 + 64*128 + 128^2 + 128*256 + 256^2*2 + 256*512 + 512^2*2 + 512^2*3) + 7*7*512*4096 + 4096^2 + 4096*2622;
